// 泛型函数的类型定义

function identity<T>(arg: T): T {
    return arg;
}



let myIdentity1: <T>(arg: T) => T = identity;
let myIdentity2: <U>(arg: U) => U = identity;
let myIdentity3: {<T>(arg: T): T} = identity;
interface GenericIdentityFn {
    <T>(arg: T): T;
}
let myIdentity4: GenericIdentityFn = identity;

const a11 = myIdentity4<number>(123)
// const a2 = myIdentity<number>(123)
// const a3 = myIdentity("123");
// const a4 = myIdentity<string>("123");